package edu.wisc.hevea.hsql;

import java.sql.Timestamp;

public class Message {
    private String msgId;
    private String topic;
    private String content;
    private String status;
    private Timestamp msgTime;
    
    @Override
    public String toString() {
    	StringBuilder msg = new StringBuilder();
    	msg.append("MSG_ID:" + msgId + " ");
    	msg.append("TOPIC:" + topic + " ");
    	msg.append("CONTENT:" + content + " ");
    	msg.append("STATUS:" + status + " ");
    	msg.append("MSG_TIME:" + msgTime + " ");
    	return msg.toString();
    }    
    
    @Override 
    public boolean equals(Object other) {
        boolean result = false;
        if (other instanceof Message) {
        	result = ((Message)other).getMsgId().equals(this.msgId);
        }
        return result;
    }
    
	public String getMsgId() {
		return msgId;
	}
	public void setMsgId(String msgId) {
		this.msgId = msgId;
	}
	public String getTopic() {
		return topic;
	}
	public void setTopic(String topic) {
		this.topic = topic;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public Timestamp getMsgTime() {
		return msgTime;
	}
	public void setMsgTime(Timestamp msgTime) {
		this.msgTime = msgTime;
	}
}
